package com.erhuogo.bean;

import java.util.List;

/**
 * 后台管理列表页分页Bean
 * @author aibinxiao
 * @date 2017年2月8日 上午9:19:53
 */
public class GridPageBean<T> {//范型的使用
	private int pageSize;//  每页显示的记录条数
	private List<T> rows;//当前页每一行的内容
    private int page;//当前页
    private int total;//一共多少页
    
    private int startIndex;// 每页开始记录的索引			          计算出来
    private int records;//总记录的条数
	
	public GridPageBean() {
		super();
	}

	public GridPageBean(int page, int records, int pageSize){
		this.page = page;
		this.pageSize = pageSize;
		this.records = records;
		//总共的页数				计算出来
		total = records%pageSize==0?records/pageSize:records/pageSize+1;
		//每页开始记录的索引			计算出来
		startIndex = (page-1)*pageSize;
	}

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getRecords() {
        return records;
    }

    public void setRecords(int records) {
        this.records = records;
    }

	public List<T> getRows() {
		return rows;
	}

	public void setRows(List<T> rows) {
		this.rows = rows;
	}

	public int getStartIndex() {
		return startIndex;
	}

	public void setStartIndex(int startIndex) {
		this.startIndex = startIndex;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

}
